package com.wn.cloud.consumer.client;

import com.wn.cloud.common.entity.Payment;
import com.wn.cloud.common.response.CommonResult;
import com.wn.cloud.common.response.DataResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @FileName: PaymentClient
 * @Description: TODO
 * @Author: MaWenHao
 * @Created: 2020/3/28 - 22:32
 * @Version: V1.0
 * @Company: 东方微银科技（北京）有限公司
 */
@Component
@FeignClient(name = "cloud-payment-service")
public interface PaymentClient {

    @GetMapping("/payment/{id}")
    DataResult<Payment> getOne(@PathVariable("id") long id);

    @PostMapping("/payment")
    CommonResult save(@RequestBody Payment payment);
}
